const router = require('koa-router')();
const controller = require('../controller/iptable')
const auth = require('../util/auth')

//查
router.get('/',controller.find);
// 查 动态路由
router.get('/:id/:ips_id', controller.detail);
router.get('/:id', controller.detail);


// 增
router.post('/', controller.add);

// 改
router.put('/:id',auth.isAdmin, controller.update);
router.put('/:id/:ips_id',auth.isAdmin, controller.updateIps);
router.put('/setsnmp/:id',auth.isAdmin, controller.updateSnmp);

// 删
router.del('/:id',auth.isAdmin, controller.delete);



module.exports = router;
